package com.ticket.sass.admin.dto.output.config;

import cn.hutool.core.util.StrUtil;
import com.ticket.sass.common.entity.tenant.WxPayConfigEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author ywb
 * @date 2024-04-28 11:34
 */
@Data
@ApiModel
public class WxPayConfigOutput {
    @ApiModelProperty(value = "商户号")
    private String mchId;
    
    @ApiModelProperty(value = "商户密钥")
    private String mchKey;
    
    @ApiModelProperty(value = "p12证书内容")
    private Boolean p12Exist;
    
    public WxPayConfigOutput() {
    }
    
    public WxPayConfigOutput(WxPayConfigEntity entity) {
        this.mchId = entity.getMchId();
        this.mchKey = entity.getMchKey();
        this.p12Exist = StrUtil.isNotEmpty(entity.getP12Content());
    }
}
